<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <!-- 标签之间的display属性是可以转换的 -->
    <style>
        img{
            display: block;
            margin-left: auto;
            margin-right: auto;
            width: 300px;
            height: 300px;
        }
        a{
            display: block;
            width: 100px;
            height: 100px;
            margin-left: auto;
            margin-right: auto;
        }
    </style>
</head>
<body>
    <img src="images/yan.jpg" alt="">
    <a href="http://baidu.com">百度</a>
</body>
</html>